<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <script src="js/common.js"></script>
	<script src="js/mui.min.js"></script>
	<script src="js/mui.enterfocus.js"></script>
	<script src="js/app.js"></script>
    <link href="css/mui.min.css" rel="stylesheet"/>
    	<style>
			#close {
				position: absolute;
				width: 160px;
				left: 50%;
				margin-left: -80px;
				bottom: 15%;
				padding: 10px;
				color: #fff;
				border-color: #fff;
			}
			.item-logo {
				width: 100%;
				height: 100%;
				position: relative;
			}
			.item-logo a {
				width: 200px;
				height: 200px;
				display: block;
				border: 1px solid #FFFFFF;
				border-color: rgba(255, 255, 255, 0.5);
				text-align: center;
				line-height: 200px;
				border-radius: 50%;
				font-size: 40px;
				color: #fff;
				position: absolute;
				top: 15%;
				left: 50%;
				margin-left: -100px;
			}
			.animate {
				position: absolute;
				left: 0;
				bottom: 15%;
				width: 100%;
				color: #fff;
				display: -moz-box;
			}
			.animate h2 {
				text-align: center;
				margin-bottom: 20px;
			}
			.animate li {
				width: 50%;
				height: 30px;
				line-height: 30px;
				list-style: none;
				font-size: 16px;
				text-align: right;
			}
			.animate li:nth-child(3) {
				text-align: left;
				float: right;
			}
			.animated {
				-webkit-animation-duration: 1s;
				-webkit-animation-play-state: paused;
				-webkit-animation-fill-mode: both;
			}
			.guide-show .bounceInDown {
				-webkit-animation-name: bounceInDown;
				-webkit-animation-play-state: running;
				-webkit-animation-delay: 1s;
				display: block;
			}
			.guide-show .bounceInLeft {
				-webkit-animation-name: bounceInLeft;
				display: block;
				-webkit-animation-play-state: running;
			}
			.guide-show .bounceInRight {
				-webkit-animation-name: bounceInRight;
				display: block;
				-webkit-animation-play-state: running;
				-webkit-animation-delay: 0.5s;
			}
			.tiyanbutton{
				bottom: 4%;
			}
			@-webkit-keyframes bounceInDown {
				0%, 60%, 75%, 90%, 100% {
					-webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
					animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
				}
				0% {
					opacity: 0;
					-webkit-transform: translate3d(0, -3000px, 0);
					transform: translate3d(0, -3000px, 0);
				}
				60% {
					opacity: 1;
					-webkit-transform: translate3d(0, 25px, 0);
					transform: translate3d(0, 25px, 0);
				}
				75% {
					-webkit-transform: translate3d(0, -5px, 0);
					transform: translate3d(0, -5px, 0);
				}
				90% {
					-webkit-transform: translate3d(0, 3px, 0);
					transform: translate3d(0, 3px, 0);
				}
				100% {
					-webkit-transform: none;
					transform: none;
				}
			}
			@-webkit-keyframes bounceInLeft {
				0%, 60%, 75%, 90%, 100% {
					-webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
					animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
				}
				0% {
					opacity: 0;
					-webkit-transform: translate3d(-3000px, 0, 0);
					transform: translate3d(-3000px, 0, 0);
				}
				60% {
					opacity: 1;
					-webkit-transform: translate3d(25px, 0, 0);
					transform: translate3d(25px, 0, 0);
				}
				75% {
					-webkit-transform: translate3d(-10px, 0, 0);
					transform: translate3d(-10px, 0, 0);
				}
				90% {
					-webkit-transform: translate3d(5px, 0, 0);
					transform: translate3d(5px, 0, 0);
				}
				100% {
					-webkit-transform: none;
					transform: none;
				}
			}
			@-webkit-keyframes bounceInRight {
				0%, 60%, 75%, 90%, 100% {
					-webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
					animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
				}
				0% {
					opacity: 0;
					-webkit-transform: translate3d(3000px, 0, 0);
					transform: translate3d(3000px, 0, 0);
				}
				60% {
					opacity: 1;
					-webkit-transform: translate3d(-25px, 0, 0);
					transform: translate3d(-25px, 0, 0);
				}
				75% {
					-webkit-transform: translate3d(10px, 0, 0);
					transform: translate3d(10px, 0, 0);
				}
				90% {
					-webkit-transform: translate3d(-5px, 0, 0);
					transform: translate3d(-5px, 0, 0);
				}
				100% {
					-webkit-transform: none;
					transform: none;
				}
			}
		</style>
    <script type="text/javascript" charset="utf-8">
      	(function($, doc) {
			$.init({
					statusBarBackground: '#f7f7f7'
				});
			mui.init();
			$.plusReady(function() {
				plus.screen.lockOrientation("portrait-primary");
				var goToVerReg=function(){
					$.openWindow({
						url: 'html/verify_reg.html',
						id: 'verify_reg',
						preload: true,
						show: {
							aniShow: 'pop-in'
						},
						styles: {
							popGesture: 'hide'
						},
						waiting: {
							autoShow: false
						}
					});
				}
				var gotoLogin=function(){
					$.openWindow({
						url: 'html/login.html',
						id: 'login',
						show: {
							aniShow: 'pop-in'
						},
						styles: {
							popGesture: 'hide'
						},
						waiting: {
							autoShow: false
						}
					});
				} 
				var loginButton=document.getElementById("loginNow");
				loginButton.addEventListener('tap', function(event) {
					gotoLogin();
				});
				//先判断是否通过了审核，没审核的直接跳转到查询页面，审核通过的判断是否登录过，没登录的不记录用户名密码，
				var users = JSON.parse(localStorage.getItem('$users') || '[]');
				var ifLogin;
				var userName ;
				var password ;
				var checkStatus;
				users.some(function(user) {
					userName =  user.userName;
					password =  user.password;
					checkStatus = user.checkStatus;
					ifLogin=user.ifLogin;
				});
				if(ifLogin==undefined||ifLogin=='0'){//直接跳转登录页面
					gotoLogin();
					return;
				}
				if(checkStatus!='1'){//未审核、未注册、未通过审核
					goToVerReg();
				}
				if(ifLogin=='1'){//登录过
					var url=baseUrl+"/dapi/m_user/login/"+userName+"/"+password;
					mui.ajax(url,{
					    dataType:'json',//服务器返回json格式数据
					    type:'get',//HTTP请求类型	
					    timeout:10000,//超时时间设置为10秒；
					    headers:{'Content-Type':'application/json'},                  
					    success:function(data){
					    	var daStatus=data.status;
					    	if(daStatus=='1'){
					    	var userInfo={
					    		id:data.data.id,
					    		userName: data.data.userName,
								password: password,
								phone: data.data.phone,
								realName: data.data.realName,
								registCode:data.data.registCode,
								checkStatus:data.data.checkStatus,
								ifLogin:'1'
				    		};
					    	var users = JSON.parse(localStorage.getItem('$users') || '[]');
							users.push(userInfo);
							localStorage.setItem('$users', JSON.stringify(users));
							$.openWindow({
								url: './html/webviewMain.html',
								id: 'webviewMain',
								preload: true,
								show: {
									aniShow: 'pop-in'
								},
								styles: {
									popGesture: 'hide'
								},
								waiting: {
									autoShow: false
								}
							});
					    	}else{
					    		gotoLogin();
					    	}
					    	
					    },
					    error:function(data){
					    	gotoLogin();
					    }
					});
					
				}else{//还未登录过，整到登录页面
					gotoLogin();
				}
					
			});
		}(mui, document));
      	
      	
    </script>
</head>
<body>
		<div id="slider" class="mui-slider mui-fullscreen" style="background-color: black;">
			<div class="mui-slider-group">
				<!-- 第一张 -->
				<div class="mui-slider-item">
					<div class="item-logo" style="background-color: #67C962">
						<a href="#">
						鑫多多
						</a>
						<!--<div class="animate guide-show">
							<h2 class="animated bounceInDown">经济实惠</h2>
							<li class="animated bounceInLeft">好吃不贵</li>
							<li class="animated bounceInRight">太帅了</li>
						</div>-->
					</div>
				</div>
				
			</div>
			<div class="animate tiyanbutton" style="text-align: center;">
				<button  class="mui-btn mui-btn-warning mui-btn-outlined" style="color: #FFFFFF;" id="loginNow">立即体验</button>
			</div>
		</div>
</body>
</html>